from bs4 import BeautifulSoup
f=open('d:/tmp/2.htm')
data=f.read()
f.close()
#data=data.decode('gbk')
soup=BeautifulSoup(data,'html5lib',from_encoding='gbk')
data=str(soup)
dd=data.decode('utf-8').encode('gbk','ignore')

print dd
